#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int com(const void* e1, const void* e2)
{

    return (*(int*)e1 - *(int*)e2);
}
int main()
{
    int n = 0;
    scanf("%d", &n);
    int arr[100000] = { 0 };
    int arr2[100000] = { 0 };
    int i = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    qsort(arr, n, 4, com);
    for (i = 0; i < n; i++)
    {
        printf("%d", arr[i]);
    }

    int j = 0;
    for (i = 0; i < n; i++)
    {
        if (arr[i] != arr[i + 1])
        {
            arr2[j] = arr[i];
            j++;
        }

    }
    for (i = 0; i < j; i++)
    {
        printf("%d ", arr2[i]);

    }
    printf("\n");

    return 0;
}




#include <stdio.h>

int main()
{
    int n = 0;
    while (scanf("%d", &n) == 1)
    {
        int i = 0;
        for (i = 0; i < n; i++)
        {
            int j = 0;
            for (j = n - i - 1; j > 0; j--)
            {
                printf("  ");
            }
            for (j = n - (n - i - 1); j > 0; j--)
            {
                printf("* ");
            }
            printf("\n");
        }
    }


    return 0;
}